#include "register.h"
#include "ui_register.h"

Register::Register(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Register)
{
    ui->setupUi(this);

}

Register::~Register()
{
    delete ui;
}


void Register::on_enter_clicked()
{
    //从文本框获取数据
    QString name       = ui->name->text();
    QString id         = ui->id->text();
    QString department = ui->department->text();
    QString gender     = ui->gender->text();
    QString age        = ui->age->text();

    emit send(name, id, department, gender, age);  //发送包含数据的send信号回到父窗口

    this->destroy();  //删除子窗口
}

void Register::on_back_clicked()
{
    this->destroy();  //删除子窗口
}
